﻿using System.Data;


namespace WindowsFormsApplication1 {


    public partial class Donnees
    {
        partial class ParametreDataTable
        {

            public const string FIELD_USERID = "personneId";
            public const string FIELD_VALEUR = "valeur";
            public const string FIELD_PARAMNAME = "parametre";

            public const string PARAM_COULEUR_VAL = "couleur";

            override public void EndInit()
            {
                this.personneIdColumn.ColumnName = ParametreDataTable.FIELD_USERID;
                this.valeurColumn.ColumnName = ParametreDataTable.FIELD_VALEUR;
                this.paramNameColumn.ColumnName = ParametreDataTable.FIELD_PARAMNAME;
            }




            public DataRow[] getCouleurByUserId(string userid)
            {

                return this.GetRowByuseridandParm(userid, PARAM_COULEUR_VAL);
            }

            private DataRow[] GetRowByuseridandParm(string usertid, string param)
            {

                return this.Select(FIELD_USERID + "=" + usertid + " AND " +ParametreDataTable.FIELD_PARAMNAME+ " Like '%" + param + "%'");
            }


            public DataRow AddCouleurByUserId(string userid)
            {
                return this.AddCouleurByUserIdandParam(userid, PARAM_COULEUR_VAL);

            }

            private DataRow AddCouleurByUserIdandParam(string userid, string param)
            {

                DataRow row = this.NewRow();
                row[ParametreDataTable.FIELD_USERID] = userid;
                row[ParametreDataTable.FIELD_PARAMNAME] = param;
                this.Rows.Add(row);
                return row;

            }
        }
    
        partial class vacanceDataTable
        {
        }
    
        partial class PersonneDataTable
        {

            public const string FIELD_ID = "id";
            public const string COLUMN_FIELD_BUTTONCOULEUR = "Ccouleur";
            
            override public void EndInit()
            {

                this.idColumn.ColumnName = PersonneDataTable.FIELD_ID;
               
            }

        }
    }
}
